package com.lianzhihui.romeex.mvp.presenter;

import android.content.Context;

import com.lianzhihui.romeex.bean.InvitationInfoBean;
import com.lianzhihui.romeex.bean.UserInfoBean;
import com.lianzhihui.romeex.mvp.model.InvitationModelImp;
import com.lianzhihui.romeex.mvp.model.InvitationModelInterface;
import com.lianzhihui.romeex.mvp.view.InvitationView;

//逻辑实现
public class InvitationPresnterImp implements InvitationModelInterface {

    private final InvitationView viewLayer;
    private final InvitationModelImp modelImp;

    public InvitationPresnterImp(Context context, InvitationView viewLayer) {
        this.viewLayer = viewLayer;
        modelImp = new InvitationModelImp(context, this);
    }

    public void requestHomeInfo() {
        modelImp.requestUserInfo();
    }

    public void requestBindInfo() {
        modelImp.requestBindInfo();
    }


    @Override
    public void responseSuccess(UserInfoBean b) {
        viewLayer.success(b);
    }

    @Override
    public void responseFailed(int codeError, String str) {
        viewLayer.failed(codeError, str);
    }

    @Override
    public void responseBindInfoSuccess(InvitationInfoBean b) {
        viewLayer.responseBindInfoSuccess(b);
    }

    @Override
    public void responseBindInfoFailed(int codeError, String errorStr) {
        viewLayer.failed(codeError, errorStr);
    }
}
